Skip to content

Conversation

velocitysystems
Copy link
Contributor

@velocitysystems velocitysystems commented Jul 11, 2025

Fixed:
#2593

Key Changes

  • Add Upload demo to example project
  • Add tests for upload method
  • Use Tokio to spawn task when invoking download or upload command
  • Fix bug where upload progress not properly reported from file_to_body function

Screenshots
image

Screenshot_1752595073

Copy link
Contributor

github-actions bot commented Jul 11, 2025

Package Changes Through 9549d50

There are 8 changes which include barcode-scanner with minor, barcode-scanner-js with minor, upload with patch, upload-js with patch, window-state with minor, window-state-js with minor, fs with patch, fs-js with patch

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
api-example 2.0.30 2.0.31
api-example-js 2.0.26 2.0.27
barcode-scanner 2.3.0 2.4.0
barcode-scanner-js 2.3.0 2.4.0
fs 2.4.0 2.4.1
fs-js 2.4.0 2.4.1
dialog 2.3.0 2.3.1
dialog-js 2.3.0 2.3.1
http 2.5.0 2.5.1
http-js 2.5.0 2.5.1
persisted-scope 2.3.0 2.3.1
upload 2.3.0 2.3.1
upload-js 2.3.0 2.3.1
window-state 2.3.0 2.4.0
window-state-js 2.3.0 2.4.0

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@velocitysystems velocitysystems force-pushed the bug/2393_ui_thread_locking branch 2 times, most recently from 3d030df to 578625a Compare July 15, 2025 16:01
@velocitysystems
Copy link
Contributor Author

velocitysystems commented Jul 15, 2025

Tested upload demo on the following platforms:

  • macOS
  • Windows^
  • Android (emulator)
  • iOS (simulator)

Verified no locking of the main (UI) thread occurs when downloading or uploading.

^ When testing on Windows, I ran into the issues described in #2852. Switching to the Brownfield pattern in a local branch allowed me to test and validate the behavior was correct.

@velocitysystems velocitysystems marked this pull request as ready for review July 15, 2025 16:17
@velocitysystems velocitysystems requested a review from a team as a code owner July 15, 2025 16:17
@velocitysystems
Copy link
Contributor Author

@lucasfernog Fixed this issue.

FYI - I noticed mobile support isn't added in the example project; I had to manually run tauri ios init and tauri android init. Should this be included in another PR? I wasn't sure if there was a compelling reason why this isn't included.

@velocitysystems
Copy link
Contributor Author

Added tests for upload method.

Copy link
Member

@FabianLars FabianLars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the pr just a nitpick annotated and we'll also need a changefile :) (check .changes dir for examples)

@velocitysystems velocitysystems force-pushed the bug/2393_ui_thread_locking branch from 8fb9ad0 to 667a0d2 Compare July 18, 2025 11:28
@velocitysystems
Copy link
Contributor Author

thanks for the pr just a nitpick annotated and we'll also need a changefile :) (check .changes dir for examples)

Thanks for the review @FabianLars! Just pushed a commit to resolve your comments.

@velocitysystems velocitysystems force-pushed the bug/2393_ui_thread_locking branch from f93d2d5 to 2cd12e4 Compare July 18, 2025 13:02
Copy link
Member

@FabianLars FabianLars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks :)

@FabianLars FabianLars merged commit b729203 into tauri-apps:v2 Jul 18, 2025
173 checks passed
@velocitysystems velocitysystems deleted the bug/2393_ui_thread_locking branch July 18, 2025 20:20
@lucasfernog
Copy link
Member

amazing PR!

Blankll added a commit to geek-fun/dockit that referenced this pull request Sep 13, 2025
![snyk-top-banner](https://res.cloudinary.com/snyk/image/upload/r-d/scm-platform/snyk-pull-requests/pr-banner-default.svg)


<h3>Snyk has created this PR to upgrade @tauri-apps/plugin-dialog from
2.2.2 to 2.3.1.</h3>

:information_source: Keep your dependencies up-to-date. This makes it
easier to fix existing vulnerabilities and to more quickly identify and
fix newly disclosed vulnerabilities when they affect your project.

<hr/>


- The recommended version is **2 versions** ahead of your current
version.

- The recommended version was released **25 days ago**.



<details>
<summary><b>Release notes</b></summary>
<br/>
  <details>
    <summary>Package name: <b>@tauri-apps/plugin-dialog</b></summary>
    <ul>
      <li>
<b>2.3.1</b> - <a
href="https://redirect.github.com/tauri-apps/plugins-workspace/releases/tag/upload-v2.3.1">2025-07-20</a></br><h2>[2.3.1]</h2>
<ul>
<li><a
href="https://redirect.github.com/tauri-apps/plugins-workspace/commit/b7292030594daa04e78979214478031241b6e38e"><code>b7292030</code></a>
(<a
href="https://redirect.github.com/tauri-apps/plugins-workspace/pull/2838"
data-hovercard-type="pull_request"
data-hovercard-url="/tauri-apps/plugins-workspace/pull/2838/hovercard">#2838</a>
by <a
href="https://redirect.github.com/tauri-apps/plugins-workspace/../../velocitysystems">@
velocitysystems</a>) Fix <code>download</code> and <code>upload</code>
locks main thread on Android.<br>
Use Tokio to spawn task when invoking commands.</li>
</ul>
<details>
<summary><em><h4>Cargo Publish</h4></em></summary>
<div class="snippet-clipboard-content notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Updating crates.io
index
Packaging tauri-plugin-upload v2.3.1
(/home/runner/work/plugins-workspace/plugins-workspace/plugins/upload)
    Updating crates.io index
    Packaged 25 files, 206.3KiB (86.1KiB compressed)
Uploading tauri-plugin-upload v2.3.1
(/home/runner/work/plugins-workspace/plugins-workspace/plugins/upload)
    Uploaded tauri-plugin-upload v2.3.1 to registry `crates-io`
note: waiting for `tauri-plugin-upload v2.3.1` to be available at
registry `crates-io`.
You may press ctrl-c to skip waiting; the crate should be available
shortly.
Published tauri-plugin-upload v2.3.1 at registry `crates-io`"><pre
class="notranslate"><code>Updating crates.io index
Packaging tauri-plugin-upload v2.3.1
(/home/runner/work/plugins-workspace/plugins-workspace/plugins/upload)
    Updating crates.io index
    Packaged 25 files, 206.3KiB (86.1KiB compressed)
Uploading tauri-plugin-upload v2.3.1
(/home/runner/work/plugins-workspace/plugins-workspace/plugins/upload)
    Uploaded tauri-plugin-upload v2.3.1 to registry `crates-io`
note: waiting for `tauri-plugin-upload v2.3.1` to be available at
registry `crates-io`.
You may press ctrl-c to skip waiting; the crate should be available
shortly.
   Published tauri-plugin-upload v2.3.1 at registry `crates-io`
</code></pre></div>
</details>
      </li>
      <li>
        <b>2.3.0</b> - 2025-06-25
      </li>
      <li>
        <b>2.2.2</b> - 2025-05-20
      </li>
    </ul>
from <a
href="https://redirect.github.com/tauri-apps/plugins-workspace/releases">@tauri-apps/plugin-dialog
GitHub release notes</a>
  </details>
</details>

---

> [!IMPORTANT]
>
> - Check the changes in this PR to ensure they won't cause issues with
your project.
> - This PR was automatically created by Snyk using the credentials of a
real user.

---

**Note:** _You are seeing this because you or someone else with access
to this repository has authorized Snyk to open upgrade PRs._

**For more information:** <img
src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiI1YzRiYzliOC02NjRjLTQ5MzMtOWQ3NC00ZGVlMDE0NzY1ZDMiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6IjVjNGJjOWI4LTY2NGMtNDkzMy05ZDc0LTRkZWUwMTQ3NjVkMyJ9fQ=="
width="0" height="0"/>

> - 🧐 [View latest project
report](https://app.snyk.io/org/blankll/project/d19c39b4-9b25-4232-b09a-2d71e94c8a24?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 📜 [Customise PR
templates](https://docs.snyk.io/scan-using-snyk/pull-requests/snyk-fix-pull-or-merge-requests/customize-pr-templates?utm_source=&utm_content=fix-pr-template)
> - 🛠 [Adjust upgrade PR
settings](https://app.snyk.io/org/blankll/project/d19c39b4-9b25-4232-b09a-2d71e94c8a24/settings/integration?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 🔕 [Ignore this dependency or unsubscribe from future upgrade
PRs](https://app.snyk.io/org/blankll/project/d19c39b4-9b25-4232-b09a-2d71e94c8a24/settings/integration?pkg&#x3D;@tauri-apps/plugin-dialog&amp;utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr#auto-dep-upgrades)

[//]: #
'snyk:metadata:{"customTemplate":{"variablesUsed":[],"fieldsUsed":[]},"dependencies":[{"name":"@tauri-apps/plugin-dialog","from":"2.2.2","to":"2.3.1"}],"env":"prod","hasFixes":false,"isBreakingChange":false,"isMajorUpgrade":false,"issuesToFix":[],"prId":"5c4bc9b8-664c-4933-9d74-4dee014765d3","prPublicId":"5c4bc9b8-664c-4933-9d74-4dee014765d3","packageManager":"npm","priorityScoreList":[],"projectPublicId":"d19c39b4-9b25-4232-b09a-2d71e94c8a24","projectUrl":"https://app.snyk.io/org/blankll/project/d19c39b4-9b25-4232-b09a-2d71e94c8a24?utm_source=github&utm_medium=referral&page=upgrade-pr","prType":"upgrade","templateFieldSources":{"branchName":"default","commitMessage":"default","description":"default","title":"default"},"templateVariants":[],"type":"auto","upgrade":[],"upgradeInfo":{"versionsDiff":2,"publishedDate":"2025-07-20T21:41:14.635Z"},"vulns":[]}'

Co-authored-by: snyk-bot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants